/*
 * WidgetClickeableWithText.cpp
 *
 *  Created on: Apr 21, 2012
 *      Author: gonzalo
 */

#include "WidgetClickeableWithText.h"

void WidgetClickeableWithText::init(std::string text)
{
	SDL_Rect rectangle = parcel->getRectangle();
    this->text = text;
    this->label = new Label(text, this, rectangle.w / 2, rectangle.h / 2);
}

WidgetClickeableWithText::WidgetClickeableWithText(std::string text,Color color,int width,
		int height,int posX, int posY, Widget* parent):
WidgetClickeable(color,width,height,posX,posY,parent){
    init(text);
}


WidgetClickeableWithText::WidgetClickeableWithText(std::string text,std::string path,int posX, int posY, Widget* parent):
WidgetClickeable(path,posX,posY,parent){
	init(text);

}

void WidgetClickeableWithText::showOn(SDL_Surface* surface) {
	label->showOn(this->surface);
	Widget::showOn(surface);
}

std::string WidgetClickeableWithText::getText(){
	return this->text;
}

WidgetClickeableWithText::~WidgetClickeableWithText() {
	delete this->label;
}
